package controllers

import (
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/logs"
	"go-cms/models"
	_ "go-cms/models"
	"go-cms/utils"
)

type MainController struct {
	beego.Controller
}

func (c *MainController) Get() {
	//c.Data["Website"] = "Beego"
	//c.Data["Email"] = "liuzhuang@6iuu.com"

	c.SetSession("cmsusername","Liu")

	user := c.GetSession("cmsusername")

	logs.Informational("user ",user," login in!")
	//fmt.Println("user = ",user)
	//models.UpdatePage()
	//page := models.GetPage()
	//c.Data["Website"] = page.Website
	//c.Data["Email"] = page.Email

	menuStruct := models.MenuStruct()
	utils.SerializeMap(menuStruct)

	c.TplName = "common/layout.html"
}

